package learningjava;

public class ChFrame extends javax.swing.JFrame {

    public ChFrame() {
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        calcButton = new javax.swing.JRadioButton();
        bdButton = new javax.swing.JRadioButton();
        bdLocalButton = new javax.swing.JRadioButton();

        setResizable(false);

        buttonGroup1.add(calcButton);
        calcButton.setText("Калькулятор");
        calcButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                calcButtonActionPerformed(evt);
            }
        });

        buttonGroup1.add(bdButton);
        bdButton.setText("БД");
        bdButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bdButtonActionPerformed(evt);
            }
        });

        buttonGroup1.add(bdLocalButton);
        bdLocalButton.setText("БД Локальная");
        bdLocalButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bdLocalButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(calcButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bdButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bdLocalButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(297, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(calcButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(bdButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(bdLocalButton)
                .addContainerGap(224, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void calcButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_calcButtonActionPerformed
        MainClass.fmChoice(1);
        this.setVisible(false);
    }//GEN-LAST:event_calcButtonActionPerformed

    private void bdButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bdButtonActionPerformed
        MainClass.fmChoice(2);
        this.setVisible(false);
    }//GEN-LAST:event_bdButtonActionPerformed

    private void bdLocalButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bdLocalButtonActionPerformed
        MainClass.fmChoice(3);
        this.setVisible(false);
    }//GEN-LAST:event_bdLocalButtonActionPerformed

    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JRadioButton bdButton;
    private javax.swing.JRadioButton bdLocalButton;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JRadioButton calcButton;
    // End of variables declaration//GEN-END:variables
}
